-
Notifications
You must be signed in to change notification settings - Fork 121
Smooth MHD Convergence Cases #1040
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Smooth MHD Convergence Cases #1040
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
High-level Suggestion
The 2D magnetic vortex test case is known to fail its convergence test due to existing solver limitations. It should be removed from this PR and introduced later, along with the necessary solver fixes, to avoid adding non-functional code and maintenance overhead. [High-level, importance: 8]
Solution Walkthrough:
Before:
# PR adds a new 2D test case and its implementation
# examples/2D_mhd_magnetic_vortex/case.py
json.dumps(
{
"patch_icpp(1)%hcid": 252,
# ... other parameters
}
)
! src/common/include/2dHardcodedIC.fpp
...
case (252) ! MHD Smooth Magnetic Vortex
! ... calculations for vortex initial conditions
case (270)
...
# tests/A48CA601/
# (new directory with golden files for the failing test)After:
# The 2D test case and its related files are removed.
# examples/2D_mhd_magnetic_vortex/case.py
# (file is removed)
! src/common/include/2dHardcodedIC.fpp
...
! case (252) is removed
case (270)
...
# tests/A48CA601/
# (directory is removed)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1040 +/- ##
=======================================
Coverage 46.02% 46.02%
=======================================
Files 67 67
Lines 13437 13437
Branches 1550 1550
=======================================
Hits 6185 6185
Misses 6362 6362
Partials 890 890 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This PR failed tests, but the problem is that those tests are not the ones that I added. The only modifications were additional hard coded patches, new example files, and new golden files. Mostly noting that it is concerning that basically master has failed the test suite. Rerunning to try getting different output. |
User description
Description
When doing convergence testing for MHD cases, I noticed that we have no smooth cases to demonstrate convergence higher than 1st order. This PR adds two advection cases that are smooth and able to be used for convergence testing. These test include a 1D case for smooth alfven waves which advects a sine wave at a period of T=1. This is from section 6.3.1 of "The ∇·B=0 Constraint in Shock-Capturing Magnetohydrodynamics Codes" by Gábor Tóth (https://www.sciencedirect.com/author/57194241733/gabor-toth). I was able to generate plots that show convergence. I also added a 2D smooth case, which is a 2D smooth magnetic vortex from section 5.2 of "Implicit hybridized discontinuous Galerkin methods for compressible magnetohydrodynamics" by C. Ciucă, P. Fernandez, A. Christophe, N.C. Nguyen. and J. Peraire (https://www.sciencedirect.com/author/56091995200/ngoc-cuong-nguyen). This vortex advects diagonally at a period of T=10.
Notably the 2D case does NOT converge at 5th order because we do not properly enforce the zero divergence criteria of the magnetic field in cases other than 1D. I am adding this case for posterity. If any future PR adds divergence-free magnetism to MHD, a good verification test will be to do convergence testing on the 2D smooth vortex case and show the appropriate convergence.
Type of change
Scope
If you cannot check the above box, please split your PR into multiple PRs that each have a common goal.
How Has This Been Tested?
Tested on NVHPC compilers
Test Configuration:
Checklist
examples/that demonstrate my new feature performing as expected.They run to completion and demonstrate "interesting physics"
./mfc.sh formatbefore committing my codeIf your code changes any code source files (anything in
src/simulation)To make sure the code is performing as expected on GPU devices, I have:
PR Type
Enhancement, Tests
Description
Add 2D smooth magnetic vortex MHD test case for convergence testing
Implement hardcoded initial condition (case 252) with smooth vortex physics
Create example case configuration with 1024x1024 grid resolution
Generate golden test files for regression verification
Diagram Walkthrough
File Walkthrough
2dHardcodedIC.fpp
Add smooth magnetic vortex hardcoded initial conditionsrc/common/include/2dHardcodedIC.fpp
case.py
Create 2D smooth magnetic vortex example configurationexamples/2D_mhd_magnetic_vortex/case.py
golden-metadata.txt
Add test metadata for smooth vortex casetests/A48CA601/golden-metadata.txt
golden.txt
Add golden reference output for test casetests/A48CA601/golden.txt